2023-12-08

The Toronto Transit Commission (TTC) is Toronto’s public transportation system. It is a vast network that covers Toronto and the surrounding municipalities, which are collectively known as the Greater Toronto Area (GTA). The bus system is extensive, with routes that reach almost every corner of the city. The TTC operates subways, buses, and streetcars throughout the region.

The data for this analysis includes information on only buses.

The data set is skewed because it primarily includes data for late buses. This means that it does not provide a good representation of on-time buses. The data set contains data for the first six months of 2022, from January to June.

## Number of rows and columns: 27351 rows, 12 columns
## Number of unique BUS ROUTES: 224

Does the frequency of bus delays vary with the season?

The data supplied 15 incidents for why the bus was late. The data provided 15 reasons for the bus being late. The following is a table of the reasons, their frequency, and the percentage of occurrences:

incident count percentage
Operations - Operator 9554 34.93
Mechanical 7979 29.17
Collision - TTC 1823 6.67
Security 1593 5.82
Diversion 1259 4.60
General Delay 1229 4.49
Emergency Services 1114 4.07
Utilized Off Route 1080 3.95
Cleaning - Unsanitary 562 2.05
Investigation 409 1.50
Road Blocked - NON-TTC Collision 321 1.17
Vision 307 1.12
Held By 93 0.34
Late Entering Service 23 0.08
Cleaning - Disinfection 5 0.02

I studied all the reasons for bus delays, but only included the three most noteworthy: mechanical, general, and vision. I then plotted the data over time and found no correlation between the time of year and the type of delay.

Does time of day impact bus schedules?

In Toronto, buses operate 24 hours a day, 7 days a week. The bus schedule may vary depending on the day of the week and the time of year. One question that arises is whether the time of day affects the likelihood of a bus being late.

Does rush hour impact bus schedules?

During rush hour, which is typically between 7 a.m. and 9 a.m. and 5 p.m. and 7 p.m., are buses more likely to be late?

The bus is most likely to be late on which day of the week?

The bus is most likely to be late on Sunday, with an average delay of 25 minutes. The least likely day for the bus to be late is Tuesday, with an average delay of only 17 minutes.

All Bus routes

There are 224 bus routes in this data set.

Late Busses

Is there a particular bus route that is more late than others?

On Time Busses

Is there a particular bus route that is more on time than others?

The model predicts the average {min_delay} to be 54851.09 mins.

A p-value of 0.0268, is less than the commonly used significance level of 0.05. This suggests that there is evidence to reject the null hypothesis that the intercept is zero.

.
term estimate std.error statistic p.value
(Intercept) 54859.44 24780.35 2.21 0.03
time_posi 0.00 0.00 -2.21 0.03
## We fitted a linear model (estimated using OLS) to predict min_delay with
## time_posi (formula: min_delay ~ time_posi). The model explains a statistically
## significant and very weak proportion of variance (R2 = 1.79e-04, F(1, 27349) =
## 4.90, p = 0.027, adj. R2 = 1.42e-04). The model's intercept, corresponding to
## time_posi = [?], is at 54859.44 (95% CI [6288.70, 1.03e+05], t(27349) = 2.21, p
## = 0.027). Within this model:
## 
##   - The effect of time posi is statistically significant and negative (beta =
## -3.22e-05, 95% CI [-6.08e-05, -3.68e-06], t(27349) = -2.21, p = 0.027; Std.
## beta = -6.49e-07, 95% CI [-1.22e-06, -7.42e-08])
## 
## Standardized parameters were obtained by fitting the model on a standardized
## version of the dataset. 95% Confidence Intervals (CIs) and p-values were
## computed using a Wald t-distribution approximation.